﻿namespace OT.HikiSecureCenterApis.Service.Video.Res
{
    public class ResDeviceSearch
    {
        #region 属性
        /// <summary>
        /// 所属服务编号
        /// </summary>
        public string belongIndexCode { get; set; }
        /// <summary>
        /// 能力集，详见附录A.44 设备能力集中的编码设备能力集
        /// https://open.hikvision.com/docs/0f6e8e1e41a14304aeecd287530b9c95?curNodeId=0f6e8e1e41a14304aeecd287530b9c95#e043207b
        /// </summary>
        public string capability { get; set; }
        /// <summary>
        /// 设备驱动
        /// </summary>
        public string deviceKey { get; set; }
        /// <summary>
        /// 设备系列
        /// </summary>
        public string deviceType { get; set; }
        /// <summary>
        /// 设备序列号
        /// </summary>
        public string devSerialNum { get; set; }
        /// <summary>
        /// 主动设备编号
        /// </summary>
        public string deviceCode { get; set; }
        /// <summary>
        /// 资源唯一编码
        /// </summary>
        public string indexCode { get; set; }
        /// <summary>
        /// 厂商
        /// </summary>
        public string manufacturer { get; set; }
        /// <summary>
        /// 资源名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 所属区域
        /// </summary>
        public string regionIndexCode { get; set; }
        /// <summary>
        /// 所属区域路径，由唯一标示组成，最大10级，格式： @根节点@子区域1@子区域2@
        /// </summary>
        public string regionPath { get; set; }
        /// <summary>
        /// 资源类型，encodeDevice：编码设备
        /// </summary>
        public string resourceType { get; set; }
        /// <summary>
        /// 接入协议，详见附录A.6 编码设备接入协议
        /// </summary>
        public string treatyType { get; set; }
        /// <summary>
        /// 创建时间，IOS8601格式，参考附录B ISO8601时间格式说明
        /// </summary>
        public string createTime { get; set; }
        /// <summary>
        /// 更新时间，IOS8601格式，参考附录B ISO8601时间格式说明
        /// </summary>
        public string updateTime { get; set; }
        /// <summary>
        /// 该属性用于 /api/resource/v1/encodeDevice/timeRange 接口
        /// 状态小于0则资源已删除
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 该属性用于 /api/resource/v1/resource/timeRange 接口
        /// 网域
        /// </summary>
        public string netZoneId { get; set; }
        /// <summary>
        /// 该属性用于 /api/resource/v1/resource/timeRange 接口
        /// 设备ip
        /// </summary>
        public string ip { get; set; }
        /// <summary>
        /// 该属性用于 /api/resource/v1/resource/timeRange 接口
        /// 端口
        /// </summary>
        public string port { get; set; }
        #endregion

        #region  扩展方法
        /// <summary>
        /// 获取接入协议名称
        /// </summary>
        public string GetTreatyTypeName => treatyType switch {
            "hiksdk_net" => "海康SDK",
            "gb_reg" => "GB/T28181",
            "ehome_reg" => "EHOME",
            "onvif_net" => "ONVIF",
            "dhsdk_net" => "大华SDK",
            "bi_reg" => "B接口协议",
            "ezviz_net" => "萤石协议",
        };
        #endregion
    }
}
